package com.fxu.framework.core.base;

import com.fxu.framework.core.enums.BaseEnum;
import lombok.AllArgsConstructor;

/**
 * 异常错误基础类
 * 可以继承这个类写自己的业务错误代码
 * @author fangxu
 * @version 1.0.0
 */
@AllArgsConstructor
public enum ResultCode implements BaseEnum<Integer, String> {
	SUCCESS(200, ""),
	ERROR(500, ""),
	WARN(400, ""),

	PARAMS_ERROR(50000, "参数错误"),

	NO_WX_OPENID(50001, "微信授权登录未绑定，需要重新绑定"),

	NEED_LOGIN(50002, "您已经掉线了，需要重新登录"),

	NO_PERM(40001, "您还没有这个操作的权限，请联系管理员!"),
	;

	private final Integer code;
	private final String msg;

	public Integer code() {
		return this.code;
	}
	public String desc() {
		return this.msg;
	}
}